package org.carl.redis.delay.queue.listener;

import lombok.extern.slf4j.Slf4j;
import org.carl.redis.delay.queue.annotation.EnableRedisDelayQueue;
import org.carl.redis.delay.queue.core.RedisDelayQueueCenter;
import org.springframework.boot.context.event.SpringApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.core.annotation.AnnotationUtils;

@Slf4j
public class RedisDelayQueueStarterListener implements ApplicationListener<SpringApplicationEvent>, RedisDelayQueueCenter {

    @Override
    public void onApplicationEvent(SpringApplicationEvent event) {
        Class<?> applicationClass = event.getSpringApplication().getMainApplicationClass();
        EnableRedisDelayQueue enableRedisDelayQueue = AnnotationUtils.findAnnotation(applicationClass, EnableRedisDelayQueue.class);
    }
}